﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZJF.advance._01_继承;
using ZJF.advance._02_kw_protect;
using ZJF.advance._04_多态1;
using ZJF.advance._05_虚方法;
using ZJF.advance._06_new关键字;
using ZJF.advance._07_接口;
using ZJF.advance._08_接口2;

namespace ZJF.advance
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Test6();
            Test7(new TVScreenImpl());
            Test7(new PadScreenImpl());
            Console.ReadLine();
        }

        #region 面向对象多态
        static void Test1() { 
            Student s1 = new Student("李四",2,"nv","清华大学");
            s1.study();
        }


        static void Test2() {
            Tidi tidi = new Tidi("大黄", "男", "黄色");
            //tidi.gender;
            tidi.goujiao();
        }

        static void Test3() { 
            Car car= new Audi("奥迪", "EA838");
            car.run();
            car = new BMW();
            car.run();
            car = new DasAuto("大众", "EA888");
            car.run();
        }

        static void Test4() {
            Son s = new Son();
            s.money();        
        }

        static void Test5() {
            BasketBall basketBall = new BasketBall();
            basketBall.PlayBall();
        }

        #endregion

        #region 接口
        static void Test6() {
            IScreen screen = GetScreen();
            screen.Open();
            screen.Close();
            screen.Show("体育频道");
        }

        static IScreen GetScreen()
        {
            //return new TVScreenImpl();
            return new PadScreenImpl();
        }

        static void Test7(IScreen obj) {
            obj.Open();
            obj.Close();
            obj.Show("体育频道");
        }
        #endregion
    }
}
